﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PurchaseGoods.aspx.cs" Inherits="Hospital_PurchaseGoods" %>

<%@ Register Src="../System/DbPageFlip.ascx" TagName="DbPageFlip" TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>采购药品</title>
    <link href="../styles/css.css" rel="stylesheet" type="text/css"/>

    <script type="text/vbscript" src="../Common/yz.vbs"></script>

    <script type="text/javascript">

        function SelectAll() {
            var i;
            var a = document.getElementsByName('chk');
            for (i = 0; i < a.length; i++) {
                a[i].checked = true;
            }
        }
        function ClearAll() {
            var i;
            var a = document.getElementsByName('chk');

            for (i = 0; i < a.length; i++) {
                a[i].checked = false;
            }
        }
        function CheckOthers() {
            var i;
            var a = document.getElementsByName('chk');

            for (i = 0; i < a.length; i++) {

                if (a[i].checked != true) {
                    a[i].checked = true;
                }
                else {
                    a[i].checked = false;
                }
            }

        }
    </script>

    <style type="text/css">
        .style1
        {
            width: 7%;
        }
    </style>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td style="width: 4px">
                        <img src="../images/intro_left.gif" width="4" height="34" alt=""/></td>
                    <td class="intro_wordbg">
                        采购药品</td>
                    <td style="background:url(../images/intro_bg.gif); ">
                        <img src="../images/intro_right.jpg" width="118" height="34" alt="" /></td>
                </tr>
            </table>
            <table  width="98%" border="0" align="center" cellpadding="2" cellspacing="1"
                class="table_table2">
                <tr>
                    <td class="table_td3" style="width: 143px; height: 28px;">
                        采购医院</td>
                    <td class="table_td2" style="height: 28px; width: 307px;">
                        <span style="color: #ff6666">
                            <asp:Label ID="LabHospital" runat="server" Text="Label" Width="163px"></asp:Label></span></td>
                    <td class="table_td3">
                        采购单名称</td>
                    <td class="table_td2" style="height: 28px; width: 230px;">
                        <asp:TextBox ID="txtPlanName" runat="server"  InvertedComma="采购单名称"
                            Width="200px" CssClass="input_text"></asp:TextBox><span style="color: #ff6666">(*)</span></td>
                </tr>
            </table>
            <table width="98%" align="center" border="1" id="tabData">
                <tr>
                    <td align="right" style="width: 12%; height: 20px;">
                        通用名：</td>
                    <td align="left" style="width: 27%; height: 20px;">
                        <asp:TextBox ID="TextProductName" runat="server" InvertedComma="采购单名称" Width="200px"></asp:TextBox></td>
                    <td align="right" style="width: 16%; height: 36px;">
                        药品流水号：</td>
                    <td align="left" style="width: 20%; height: 36px;">
                       <asp:TextBox ID="txtGoodsId" runat="server" InvertedComma="流水号" NumericOnly="流水号" Width="250px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td align="right" style="width: 21%; height: 20px;">目录范围：</td>
                    <td>
                        <asp:DropDownList ID="DropDownList1" runat="server"  Width="207px">
                            <asp:ListItem Value="0" Selected="True">未采购的药品</asp:ListItem>
                            <asp:ListItem Value="2">所有药品</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td style="text-align:right; width:16%; height:36px; ">商品名：</td>
                    <td style="text-align:left; width:20%; height:36px; ">
                        <asp:TextBox ID="txtGoodsName" runat="server" Width="250px" ></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 12%; height: 20px;">
                        生产企业名称：</td>
                    <td align="left" style="width: 27%; height: 20px;">
                        <asp:TextBox ID="TextCompanyName_SC" runat="server" InvertedComma="采购单名称" Width="200px" ></asp:TextBox>
                    </td>
                    <td align="right" style="width: 21%; height: 20px;">
                        生产企业编号：</td>
                    <td style="width: 296px; height: 20px" align="left">
                        <asp:TextBox ID="Textuscoder_sc" runat="server" InvertedComma="生产企业编码" Width="250px" ></asp:TextBox></td>
                </tr>
                <tr>
                <td align="right" style="width: 16%; height: 28px;">配送企业名称：</td>
                <td style="height: 28px"> 
                    <asp:TextBox ID="TextCompanyName_PS" runat="server" InvertedComma="采购单名称" Width="200px" ></asp:TextBox>
                </td>
                 <td align="right" style="width:16% ; height: 28px">
                        配送企业编码：</td>
                  <td style="width: 296px; height: 28px">
                        <asp:TextBox ID="Textuscoder_ps" runat="server" InvertedComma="配送企业编码" Width="250px" ></asp:TextBox></td>
                </tr>
        
                <tr>
                    <td align="center" style="width: 16%" >
                        
                    </td>
                    <td style="width:21%; "></td>
                     <td  colspan="2" align="center" style="width: 21%; height: 20px;" ><input id="Submit2" class="button_bg6" name="btnSubmit1" style="width: 90px" type="submit"
                   onclick="javascript:return CheckForm();"
                            value="查 询" /></td>
                </tr>
            </table>
            &nbsp;
            <asp:DataList ID="DlAttorney" runat="server" Width="98%" CssClass='table_table' 
                HeaderStyle-CssClass='table_title' 
                onselectedindexchanged="DlAttorney_SelectedIndexChanged">
                <ItemStyle CssClass="table_td" />
                <AlternatingItemStyle CssClass="table_td2" />
                <HeaderTemplate>
                    <table  style="width:98%; text-align:left">
                        <tr>
                            <td style="width:7%; ">
                                药品流水号</td>
                            <td style="width:8%; ">
                                通用名</td>
                            <td style="width:8%">
                                剂型</td>
                            <td style="width:6%; ">包装</td>
                            <td style="width:6%; ">
                                商品名</td>
                            <%--<td style="width:8%; ">包装规格</td>--%>
                            <td style="width:8%; ">
                                质量层次</td>
                            <%--<td style="width:8%; ">转换系数</td>--%>
                            <td style="width:8%; ">
                                配送企业编号</td>
                            <td style="width:8%; ">
                                配送企业</td>
                            <td style="width:8%; ">
                                生产编号</td>
                            <td style="width:9%; ">
                                生产企业</td>
                            <td style="width:6%; ">
                                挂网价</td>
                            <td nowrap style="width:10%; ">
                                交易价格</td>
                            <td nowrap style="width:8%; ">
                                交易数量</td>
                            <td nowrap style="width:8%; ">
                                选择</td>
                        </tr>
                    </table>
                </HeaderTemplate>
                <ItemTemplate>
                    <table style="width:98%; text-align:left">
                        <tr >
                            <td style="color:<%=color%>; width:7%; ">
                                <%# DataBinder.Eval(Container.DataItem, "GoodsId")%>
                            </td>
                            <td style="color:<%=color%>; width:8%; ">
                                <%# DataBinder.Eval(Container.DataItem, "ProductName")%>
                            </td>
                            <td style="color:<%=color%>; width:8%; ">
                                <%# DataBinder.Eval(Container.DataItem, "MedicineModel")%>
                            </td>
                            <td style="color:<%=color%>; width:8%; ">
                                <%# DataBinder.Eval(Container.DataItem, "OutLookC")%>×<%# DataBinder.Eval(Container.DataItem, "factor")%><%# DataBinder.Eval(Container.DataItem, "pack1")%>
                            </td>
                            <td style="color:<%=color%>; width:6%; ">
                                <%# DataBinder.Eval(Container.DataItem, "GoodsName")%>
                            </td>
                            <%--<td style="color:<%=color%>; width:8%; "><%# DataBinder.Eval(Container.DataItem, "pack1")%></td>--%>
                            <td style="color:<%=color%>; width:8%; ">
                                <%# DataBinder.Eval(Container.DataItem, "QualityLevels")%>
                            </td>
                            <%--<td style="color:<%=color%>; width:8%; "><%# DataBinder.Eval(Container.DataItem, "factor")%></td>--%>
                            <td style="color:<%=color%>; width:8%; ">
                                <%# DataBinder.Eval(Container.DataItem, "UserCode_PS")%>
                            </td>
                            <td style="color:<%=color%>; width:8%; ">
                                <%# DataBinder.Eval(Container.DataItem, "CompanyName_PS")%>
                            </td>
                             <td style="color:<%=color%>; width:8%; ">
                                <%# DataBinder.Eval(Container.DataItem, "UserCode_SC")%>
                            </td>
                            <td class="style1"  style="color:<%=color%>">
                                <%# DataBinder.Eval(Container.DataItem, "CompanyName_SC")%>
                            </td>
                            <td style="color:<%=color%>; width:8%; ">
                                <%# DataBinder.Eval(Container.DataItem, "bidprice")%>
                            </td>
                            <td style="width:10%"><% if (projectid == "1")
                                   {%>
                            
                                <input name='txtprice<%# DataBinder.Eval(Container.DataItem, "SupplyGoodSId")%>'
                                    onblur="javascript:if(!/^[0-9]+(\.[0-9]{1,3})?$/.test(this.value)){alert('请输入正确的价格！');this.value='<%# DataBinder.Eval(Container.DataItem, "bidprice")%>';this.focus();};if(this.value><%# DataBinder.Eval(Container.DataItem, "bidprice")%>){alert('流水号 <%# DataBinder.Eval(Container.DataItem, "GoodsId")%>输入价格不能大于挂网价格！');this.value='<%# DataBinder.Eval(Container.DataItem, "bidprice")%>';this.focus();}; " 
                                    style="width: 42px; margin-left: 0px;" type="text" 
                                    value='<%# DataBinder.Eval(Container.DataItem, "bidprice")%>'></input>
                                    <%}
                                   else
                                   { %>
                                    <input name='txtprice<%# DataBinder.Eval(Container.DataItem, "SupplyGoodSId")%>'
                                    onblur="javascript:if(!/^[0-9]+(\.[0-9]{1,3})?$/.test(this.value)){alert('请输入正确的价格！');this.value='<%# DataBinder.Eval(Container.DataItem, "bidprice")%>';this.focus(); };" 
                                    style="width: 42px; margin-left: 0px;" type="text" readonly
                                    value='<%# DataBinder.Eval(Container.DataItem, "bidprice")%>'></input>
                                    
                                    <% }%>
                                 
                                    
                                    </td> 
                            <td width="9%">
                            
                                <input name="txtnum<%# DataBinder.Eval(Container.DataItem, "SupplyGoodSId")%>" type="text"   value="0" style="width: 42px"  onblur="javascript:if(!/^[0-9]+(\.[0-9]{1,3})?$/.test(this.value)){alert('请输入正确的数量！');this.value='0';this.focus(); };">
                            </td>
                            <td width="8%" align="center">
                                <input name="chk" type="checkbox" value='<%# DataBinder.Eval(Container.DataItem, "SupplyGoodSId")%>'>
                                <input type="hidden" name='BidPrice<%# DataBinder.Eval(Container.DataItem, "SupplyGoodSId")%>' value='<%# DataBinder.Eval(Container.DataItem, "PurchasePrice") %>'>
                                <input type="hidden" name='AccountId_PS<%# DataBinder.Eval(Container.DataItem, "SupplyGoodSId")%>' value='<%# DataBinder.Eval(Container.DataItem, "AccountId_PS") %>'>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
                <HeaderStyle CssClass="table_title" />
            </asp:DataList>
            <div align="right">
                <table>
                    <tr>
                        <td>
                            <uc1:DbPageFlip ID="DbPageFlip1" runat="server" />
                        </td>
                        <td>
                            <input id="but1" type="button" class="button_bg4" value="全选" onclick="javascript:SelectAll();" style="width: 69px" /></td>
                        <td>
                            <input id="but2" type="button" class="button_bg4" value="清空" onclick="javascript:ClearAll();" style="width: 69px" /></td>
                        <td>
                            <input id="but3" type="button" class="button_bg4" value="反选" onclick="javascript:CheckOthers();" style="width: 68px" /></td>
                        <td>
                            <input type="submit" name="btnSubmit" value="确定选取" class="button_bg4"  onclick="javascript:return CheckForm();"
                                id="Submit1" style="width: 64px" />
                        </td>
                         <td>
                            <input id="but4" type="button" class="button_bg4" value="关闭" onclick="javascript:window.opener.location.reload();window.close();" style="width: 68px" /></td>
                        <td></td>
                    </tr>
                </table>
            </div>
        </div>
    </form>
</body>
</html>